package com.woniuxy.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class MyAop {

        //   表达式：访问修饰符 返回值 包名.包名.包名…类名.方法名(参数列表)
    //带增强方法
    @Around("execution(* com.woniuxy.service.impl.UserServiceImpl..*(..))")
    public Object   log(ProceedingJoinPoint pjp) throws Throwable {
        String name = pjp.getSignature().getName();
        Object proceed = pjp.proceed();
        System.out.println("proceed:" + proceed);
        System.out.println("执行增强方法");
        return proceed;
    }
}
